package com.sloth.bear.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sloth.bear.dto.entity.NameSpace;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface NameSpaceMapper extends BaseMapper<NameSpace> {
    
    /**
     * 统计指定空间下的文档数量
     */
    @Select("SELECT COUNT(*) FROM doc WHERE namespace_id = #{namespaceId} AND deleted = 0")
    Integer countDocumentsByNamespaceId(Long namespaceId);
}